package com.campus.map;

import com.campus.model.LearnUnit;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;
/**
 * @desc:
 * @author: Tournesol234
 * @date: 2024/11/22 14.41
 */
public class LearnUnitRowMapper implements RowMapper<LearnUnit> {
    @Override
    public LearnUnit mapRow(ResultSet rs, int rowNum) throws SQLException {
        LearnUnit learnUnit = new LearnUnit();
        learnUnit.setId(rs.getInt("id"));
        learnUnit.setUnitTitle(rs.getString("unit_title"));
        learnUnit.setDocPath(rs.getString("doc_path"));
        learnUnit.setVideoPath(rs.getString("video_path"));
        learnUnit.setUnitIntroduce(rs.getString("unit_introduce"));
        learnUnit.setFatherId(rs.getInt("father_id"));
        learnUnit.setIsChpt(rs.getString("is_chpt"));
        learnUnit.setCourseId(rs.getInt("course_id"));
        learnUnit.setLearningScore(rs.getInt("learning_score"));
        return learnUnit;
    }
}
